// 用户表

package dbModel

import "time"

type User struct {
	Id         string    `json:"id" gorm:"primary_key; column:id;type:varchar(255)"`
	UserCode   string    `json:"userCode" gorm:"column:user_code;type:varchar(255)"`
	UserName   string    `json:"userName" gorm:"column:user_name; type:varchar(255)" validate:"required"`
	Password   string    `json:"password" gorm:"column:password; type:varchar(255)" validate:"required"`
	RoleId     string    `json:"roleId" gorm:"column:role_id;type:varchar(255)"`
	DefaultUser bool    `json:"defaultUser" gorm:"column:default_user;type:tinyint(1);default:0"`
	CreateTime time.Time `json:"-" gorm:"column:create_time; autoCreateTime"`
	UpdateTime time.Time `json:"-" gorm:"column:update_time; autoUpdateTime"`
}

// 数据表
func (*User) TableName() string {
	return "user"
}
